package com.itheima.pattern.singleton.demo8;


import java.lang.reflect.Constructor;

//用反射破坏单例模式
public class Client {
    public static void main(String[] args) throws Exception{
        Class singletonClass = Singleton.class;
        Constructor cons = singletonClass.getDeclaredConstructor();
        cons.setAccessible(true);
        Singleton o = (Singleton) cons.newInstance();
        Singleton o2 = (Singleton) cons.newInstance();
        System.out.println(o==o2);



    }
}
